
	$(function(){

		$(".selectDiv DIV,.selectDivNo DIV").mouseover(function(){$(this).addClass("selectDivOver");});
		$(".selectDiv DIV,.selectDivNo DIV").mouseout(function(){$(this).removeClass("selectDivOver");});
		$(".selectDivBlue DIV").mouseover(function(){$(this).addClass("selectDivBlueOver");});
		$(".selectDivBlue DIV").mouseout(function(){$(this).removeClass("selectDivBlueOver");});
		$(".whiteBtn,.whiteBtn2").mouseover(function(){$(this).addClass("selectDivOver");$(this).css("color","#ffffff");});
		$(".whiteBtn,.whiteBtn2").mouseout(function(){
			var className = $(this).attr("class");
			$(this).removeClass("selectDivOver");
			if(className.indexOf("selectDivClick")==-1)$(this).css("color","");
		});
		
		$(".oldTable tr:even,.resultTb tr:even").addClass("bgGrey2");
		$(".resultTb2 tr:odd").addClass("bgGrey2");
		
		$(".titSwitch a").mouseover(function(){//选项卡样式
        	var className = $(this).parent().attr("class");
        	if(isEmpty(className) || className.indexOf("titSwitchDq2")==-1){
        		$(this).css("color","#e73737").css("text-decoration","underline");
        	}else{
        		$(this).css("color","#ffffff");
        	}
		});
        $(".titSwitch p:not(.titSwitchDq2)").mouseout(function(){
        	var className = $(this).parent().attr("class");
        	if(isEmpty(className) || className.indexOf("titSwitchDq2")==-1){
        		$(this).find("a").css("color","").css("text-decoration","none");
        	}
        });
        
        $(".duizhangList li").mouseover(function(){$(this).addClass("duizhangListLiOver");});
        $(".duizhangList li").mouseout(function(){$(this).removeClass("duizhangListLiOver");});
        $(".xiazai").mouseover(function(){$(this).css("color","#FFFF00");});
        $(".xiazai").mouseout(function(){$(this).css("color","#FFFFFF");});
        $(".duizhangList li").click(function(){//点击选中对账单样式
            var className = $(this).attr("class");
            if(className.indexOf("duizhangListLiClick")==-1){
                $(this).addClass("duizhangListLiClick");
            }else{
                $(this).removeClass("duizhangListLiClick").removeClass("duizhangListLiOver");
            }
        }); 
        $("#pgDiv").css("width",$(".tdList5").css("width"));
		
        $(".formTb2 :input,.formTb3 :input").css("height","28px");
		$(".formTb2 :file,.formTb3 :file").css("height","28px");
		if (isIE()){
			$(".formTb2 :input,.formTb3 :input").css("padding","7px 7px 0px 7px");
			$(".formTb2 select,.formTb3 select").css("padding-top","0px");
			$(".textClass").css("height","20px");
			$(".iconList div").css("margin","16px 0px 0px 0px");
			$(".wenziLine").css("padding","10px 5px 0px 5px;");
			$("#pgDiv").css("width",parseInt($("[name=resDiv]").css("width"))+2);
        	var divList = $(".selectDivNo div");
            $.each(divList, function(i,obj){  
            	var wv = $(obj).innerWidth();
            	$(this).width(wv+5);
            });
		}else{
			$(".formTb2 :input,.formTb3 :input,.formTable2 :input").css("padding-top","0px");
			$(".textClass,.inputClass,.contentTb2 input").css("padding-top","0px");
			$(".inputClass,.contentTb2 input").css("height","30px");
			$("#pgDiv").css("width",parseInt($(".tdList5").css("width"))-2);
			$("#pgDiv").css("width",parseInt($("[name=resDiv]").css("width")));
		}
		$("#remark").css("height","50px");
		
		$(".step1_2,.step3_2").mouseover(function(){
			$(this).css("background-image","url("+ctx+"/css/img2/step5_2.png)");
		});
		$(".step1_2,.step3_2,.step1_3,.step3_3").mouseout(function(){
			var className = $(this).attr("class");
			$(this).css("background-image","url("+ctx+"/css/img2/"+className+".png)");
		});
		$(".step1_3,.step3_3").mouseover(function(){
			$(this).css("background-image","url("+ctx+"/css/img2/step5_3.png)");
		});

	});
	
	function loadingAddDiv(list,divID,key,initFun,deleteFlag){//加载选择区域
    	var div = $("#"+divID);
        $(div).html("");
        for(var i=0;i<list.length;i++){
            var name = list[i][0];
            var id = list[i][1];
            var html = "<div>";
            html+=name+"<input name='"+key+"' value='"+id+"' />";
            if(deleteFlag!=0){html+="<span onclick='deleteAddDiv(this);'>x</span>";}
            else{html+="&nbsp;&nbsp;";}
            html+="</div>";
            $(div).append(html);
        }
        if(initFun!=undefined)initFun();//执行初始化函数
        if(isIE()){
        	var divList = $("#"+divID+" div");
            $.each(divList, function(i,obj){  
            	var wv = $(obj).innerWidth();
            	$(obj).width(wv+5);
            });
        }
    }
	
	//加载选择区域2的函数
	var clickDiv;
	function seDivOver(obj){$(obj).addClass("selectDivOver");}
	function seDivOut(obj){$(obj).removeClass("selectDivOver");}
	function seDivClick(obj,name){
		$("[name="+name+"]").parent().removeClass("selectDivClick");
		$("[name="+name+"]").parent().find("input").attr("disabled",true);
		$(obj).addClass("selectDivClick");
		$(obj).find("input").attr("disabled",false);
		if(clickDiv!=undefined)clickDiv(obj);
	}
	function loadingSeDiv(list,divID,key,initFun,deleteFlag){//加载选择区域2
    	var div = $("#"+divID);
        $(div).html("");
        for(var i=0;i<list.length;i++){
            var name = list[i][0];
            var id = list[i][1];
            var html = "<div onmouseover='seDivOver(this);' onmouseout='seDivOut(this);' onclick=\"seDivClick(this,'"+key+"');\">";
            html+=name+"<input name='"+key+"' value="+id+" disabled='disabled'/>";
            if(deleteFlag!=0){html+="<span onclick='deleteAddDiv(this);'>x</span>";}
            else{html+="&nbsp;&nbsp;";}
            html+="</div>";
            $(div).append(html);
        }
        if(initFun!=undefined)initFun();//执行初始化函数
        if(isIE()){
        	var divList = $("#"+divID+" div");
            $.each(divList, function(i,obj){  
            	var wv = $(obj).innerWidth();
            	$(obj).width(wv+5);
            });
        }
    }
	
    function setHeight_resultHeight(h1,h2){//设置查询页面高度
    	parent.editIfrHeight(h1);
    	$("#result").css("height",h2);
    }
	
	function contrastDate_month(startDateStr,endDateStr){//时间相差几个月对比
		var startDate=new Date(startDateStr.replace(/-/g, "/"));    
	    var endDate=new Date(endDateStr.replace(/-/g, "/"));    
	      var number = 0;      
	      var yearToMonth = (endDate.getFullYear() - startDate.getFullYear()) * 12;      
	      number += yearToMonth;      
	      monthToMonth = endDate.getMonth() - startDate.getMonth();      
	      number += monthToMonth;
	      return number;
    	
		/**
		if(date1==undefined)return false;
    	var year = date1.split("-")[0];
    	var year2 = date2.split("-")[0];
    	var dfy = year2-year;
    	if(dfy>1 || dfy<-1)return 9999;
    	
    	date1 = date1.split("-")[1];
    	date2 = date2.split("-")[1];
    	
    	date1 = date1*1-12*dfy*1;
    	
    	var df = date2 - date1;
    	if(df<0)df = df*(-1);
      	return df;
      	*/
    }
	
    function shRes(val){
    	if(val==1){$("#result").show();}
    	else{$("#result").hide();}
    }
    
    function setReqHeight(ifeH,hv){
    	$("#result").css("height",ifeH);
    	parent.editIfrHeight(hv);
    }
	
	if(isIE()){
		document.write("<style>.selectDivNo div{line-height:15px;}</style>");
	}
	
	var checkLoad;
    var checkLoadA = 0;
    var checkLoadB = 0;
    function setReq(){
    	$("#resultDiv").css("height","auto");
    	window.clearInterval(checkLoad); 
		checkLoad = undefined;
   		checkLoad = setInterval(function(){
       		if($("#report1").css("width")!=undefined){
       			$("#resultDiv").css("border","1px solid #EAEAEA");
       			setTimeout(function(){
       				parent.editIfrHeight(hv+$("#resultDiv").height()+50);
       				$("#report1").css("border","0px");
       				$("#report1").css("border-bottom","1px solid #EBEBEB;");
     				$("#report1").css("width",$(".formTbKuang").width()-4);
     				if(isEmpty($(".formTbKuang").width())){
      					$("#report1").css("width",$(".tabTb").width()-4);
      				}
     				$("#report1_toolbarDivBottom").css("width",$("#report1").width()-1);
     				toGundong(toGundongFlag);
     				toGundongFlag = 1;
       			},50);
       			$(".numSlect").bind("click",function(){setReq();});
       			$("[class$=vrFirstPageButton],[class$=vrLastPageButton],[class$=vrNextPageButton],[class$=vrPrevPageButton]").bind("click",function(){setReq();});
       			$("#report1_printIFrame").hide();
       			window.clearInterval(checkLoad); 
       		}else{
       			$("#resultDiv").css("border","0px");
       		}
       	},50);
	}
    
    var toGundongFlag = 0;
    function toGundong(val){
    	var top1 = $("#resultDiv").offset().top;
			var top2 = $("#ifr",parent.document).offset().top;
			if(val==0)
			parent.gundong(top1+top2);
    }
	
	
	
	
	